package com.hibase.core.api.service.account.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.hibase.core.api.entity.account.MsdApiAccount;
import com.hibase.core.api.entity.account.vo.MsdApiAccountSearchVO;
import com.hibase.core.api.mapper.account.MsdApiAccountMapper;
import com.hibase.core.api.service.account.MsdApiAccountService;
import com.hibase.core.mybatis.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Lierh
 * @since 2020-10-10
 */
@Service
@Transactional(readOnly = true, rollbackFor = Exception.class)
public class MsdApiAccountServiceImpl extends BaseServiceImpl<MsdApiAccountMapper, MsdApiAccount> implements MsdApiAccountService {

    /**
     * 查询列表
     */
    @Override
    public PageInfo<MsdApiAccount> selectMsdApiAccountList(MsdApiAccountSearchVO searchVO) {

        return super.page(searchVO, new QueryWrapper<MsdApiAccount>());
    }

    /**
     * 改变记录
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveMsdApiAccount(MsdApiAccount entity) {

        super.store(entity);
    }

    /**
     * 查询详情
     */
    @Override
    public MsdApiAccount viewMsdApiAccount(String id) {

        MsdApiAccount entity = super.getById(id, true);

        return entity;
    }

    /**
     * 删除记录
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteMsdApiAccount(String id) {

        super.deleteBy(id);
    }
}
